unit uQueryBase;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DB, ADODB, Grids, DBGrids, ComCtrls;

type
  TQueryBase = class(TForm)
    grd1: TDBGrid;
    ds1: TDataSource;
    qry1: TADOQuery;
    btnQuery: TButton;
    btnClose: TButton;
    procedure FormCreate(Sender: TObject);
    procedure btnCloseClick(Sender: TObject);
    procedure btnQueryClick(Sender: TObject);
  private
  protected
    procedure DoReQuerying; virtual;

    procedure FillDatas(d1,d2:TDatetimePicker);
  public
    { Public declarations }
  end;


implementation

uses
  uDM, DateUtils;

{$R *.dfm}

procedure TQueryBase.FormCreate(Sender: TObject);
begin
  grd1.ReadOnly:=true;
end;

procedure TQueryBase.btnCloseClick(Sender: TObject);
begin
  close;
end;

procedure TQueryBase.btnQueryClick(Sender: TObject);
begin
  DoReQuerying();
  qry1.Close();
  qry1.Open();
end;

procedure TQueryBase.DoReQuerying;
begin

end;

procedure TQueryBase.FillDatas(d1, d2: TDatetimePicker);
begin
  d1.Date:=EncodeDate(yearof(Date()),1,1);
  d2.Date:=EncodeDate(yearof(Date()),12,31);
end;

end.
